Passed
Branch master (6eb04c)
by Rafael S.
01:12
created

ieee754-buffer.js ➔ pack   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 5
dl 0
loc 1
rs 10
1
/**
2
 * @fileoverview Externs for ieee754-buffer 0.0.1
3
 * @see https://github.com/rochars/ieee754-buffer
4
 * @externs
5
 */
6
7
/**
8
 * Pack a IEEE 754 floating point number.
9
 * Derived from typedarray.js by Linden Research, MIT License.
10
 * @see https://bitbucket.org/lindenlab/llsd/raw/7d2646cd3f9b4c806e73aebc4b32bd81e4047fdc/js/typedarray.js
11
 * @param {!Uint8Array|!Array<number>} buffer The buffer.
12
 * @param {number} index The index to write on the buffer.
13
 * @param {number} num The number.
14
 * @param {number} ebits The number of bits of the exponent.
15
 * @param {number} fbits The number of bits of the fraction.
16
 * @return {number} The next index to write on the buffer.
17
 */
18
function pack(buffer, index, num, ebits, fbits) {}
19
20
/**
21
 * Unpack a IEEE 754 floating point number.
22
 * Derived from IEEE754 by DeNA Co., Ltd., MIT License. 
23
 * Adapted to handle NaN. Should port the solution to the original repo.
24
 * @see https://github.com/kazuho/ieee754.js/blob/master/ieee754.js
25
 * @param {!Uint8Array|!Array<number>} buffer The buffer.
26
 * @param {number} index The index to read from the buffer.
27
 * @param {number} ebits The number of bits of the exponent.
28
 * @param {number} fbits The number of bits of the fraction.
29
 * @return {number} The floating point number.
30
 */
31
function unpack(buffer, index, ebits, fbits) {}
32